{{- define "ccm_cloud_config" }}
  {{- $providerClusterConfiguration := .Values.cloudProviderVcd.internal.providerClusterConfiguration | required "internal.providerClusterConfiguration is required" -}}
vcd:
  host: {{ $providerClusterConfiguration.provider.server }}
  org: {{ $providerClusterConfiguration.organization }}
  vdc: {{ $providerClusterConfiguration.virtualDataCenter }}
vAppName: {{ $providerClusterConfiguration.virtualApplicationName }}
clusterid: NO_RDE_{{ .Values.global.discovery.clusterUUID }}
loadbalancer:
  # This parameters is fake, we cannot allow to use LoadBalancers
  network: {{ $providerClusterConfiguration.mainNetwork }}
  enableVirtualServiceSharedIP: true
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
  name: ccm-controller-manager
  namespace: d8-cloud-provider-vcd
  {{- include "helm_lib_module_labels" (list . (dict "app" "ccm-controller")) | nindent 2 }}
type: Opaque
data:
  cloud-config: {{ include "ccm_cloud_config" . | b64enc | quote }}
